home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / count.z / count
Encoding:
Text File  |  2002-10-03  |  3.7 KB  |  98 lines

  1. COUNT(3I)                                             Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      CCOOUUNNTT - Counts the number of true array elements
  6.  
  7. SSYYNNOOPPSSIISS
  8.      CCOOUUNNTT (([MMAASSKK==]_m_a_s_k [,,[DDIIMM==]_d_i_m]))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, and IRIX systems
  12.  
  13.      CF90, MIPSpro 7 Fortran 90
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      The CCOOUUNNTT intrinsic function counts the number of true array elements
  20.      of argument _m_a_s_k along dimension _d_i_m.  It accepts the following
  21.      arguments:
  22.  
  23.      _m_a_s_k      Must be of type logical.  It must not be a scalar.
  24.  
  25.      _d_i_m       Must be a scalar.  It is an integer with a value in the
  26.                range 1 <= _d_i_m <= _n, where _n is the rank of _m_a_s_k.  The
  27.                corresponding actual argument must not be an optional dummy
  28.                argument.
  29.  
  30.      CCOOUUNNTT is a transformational function.  The name of this intrinsic
  31.      cannot be passed as an argument.
  32.  
  33. RREETTUURRNN VVAALLUUEESS
  34.      The result is type integer.  It is a scalar result if _d_i_m is absent or
  35.      if _m_a_s_k has rank 1.  Otherwise, the result is an array of rank _n-1 and
  36.      of
  37.      shape (_d , _d , ..., _d     , _d     , ..., _d ),
  38.              1   2        _d_i_m-1   _d_i_m+1        _n
  39.      where (_d , _d , ..., _d )
  40.              1   2        _n
  41.      is the shape of _m_a_s_k.
  42.  
  43.      The result of CCOOUUNNTT((_m_a_s_k)) has a value equal to the number of TTRRUUEE
  44.      elements of _m_a_s_k or has the value 0 if _m_a_s_k is a zero-sized array.
  45.  
  46.      If _m_a_s_k has rank 1, CCOOUUNNTT((_m_a_s_k,, _d_i_m)) has a value equal to that of
  47.      CCOOUUNNTT((_m_a_s_k)).  Otherwise, the value of
  48.  
  49.      element (_s , _s , ..., _s     , _s     , ..., _s )
  50.                1   2        _d_i_m-1   _d_i_m+1        _n
  51.      of CCOOUUNNTT((_m_a_s_k,, _d_i_m)) is equal to
  52.      CCOOUUNNTT((MMAASSKK (_s , _s , ..., _s     , : , _s     , ..., _s )).
  53.                   1   2        _d_i_m-1       _d_i_m+1        _n
  54.  
  55. EEXXAAMMPPLLEESS
  56.      Example 1:
  57.  
  58.      * CCOOUUNNTT(( ((// ..TTRRUUEE..,, ..FFAALLSSEE..,, ..TTRRUUEE.. //)) )) is 2.
  59.  
  60.      * CCOOUUNNTT((_m_a_s_k)) returns zero when _m_a_s_k is a zero-sized array.
  61.  
  62.      Example 2:  Assume that BB is the following array:
  63.  
  64.      | 1 3 5 |
  65.      | 2 4 6 |
  66.  
  67.      CC is the following array:
  68.  
  69.      | 0 3 5 |
  70.      | 7 4 8 |
  71.  
  72.      * CCOOUUNNTT(( BB ..NNEE.. CC)) is 33
  73.  
  74.      * CCOOUUNNTT(( BB ..NNEE.. CC,, DDIIMM==11)) is [[22,, 00,, 11]]
  75.  
  76.      * CCOOUUNNTT(( BB ..NNEE.. CC,, DDIIMM==22)) is [[11,, 22]]
  77.  
  78.      * CCOOUUNNTT(( CC ..EEQQ.. 11)) returns zero because there are no true elements in
  79.        the mask.
  80.  
  81.      Example 3:  Assume that array NN is as follows:
  82.  
  83.      | 0 1 2 3 |
  84.      | 4 5 6 7 |
  85.      | 8 9 0 1 |
  86.  
  87.      In an array section reference, you can expect the following results:
  88.  
  89.      * CCOOUUNNTT((((NN((22::33,,22::44))..NNEE..00)))) is 55
  90.  
  91.      * CCOOUUNNTT((((NN((22::33,,22::44))..NNEE..00)),,DDIIMM==11)) is [[22,, 11,, 22]]
  92.  
  93.      * CCOOUUNNTT((((NN((22::33,,22::44))..NNEE..00)),,DDIIMM==22)) is [[33,, 22]]
  94.  
  95. SSEEEE AALLSSOO
  96.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  97.      man page.
  98.